package edu.bw.service.Impl;

import edu.bw.service.ProductService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Spring-Junit4整合,含有applicationContext.xml配置文件
 */
@RunWith(SpringJUnit4ClassRunner.class) //将原来的Junit4测试框架替换成Spring的测试框架
@ContextConfiguration("classpath:applicationContext.xml")  //加载Spring配置文件
public class ProductServiceImplTest02 {
    @Autowired
    private ProductService productService;

    @Test
    public void findAll() {
        productService.findAll().forEach(System.out::println);
    }




}